import request from '@/utils/request'

// get 获得学习卡列表数据
export function getCardList(params) {
  return request({
    url: '/ops/batch/list',
    method: 'get',
    params: { batchType: params }
  })
}

// post 创建学习卡批次数据
export function addStudyCard(data) {
  return request({
    url: '/ops/batch/add',
    method: 'post',
    data: data
  })
}

// post 修改学习卡批次数据
export function updateStudyCard(data) {
  return request({
    url: '/ops/batch/update',
    method: 'post',
    data: data
  })
}

// get 删除学习卡批次数据
export function deleteBatchStudyCard(params, type) {
  return request({
    url: '/ops/batch/delete',
    method: 'get',
    params: { id: params, type: type }
  })
}

// get 获得学习卡列表数据
export function getUsedCardList(data) {
  return request({
    url: '/ops/card/list',
    method: 'post',
    data
  })
}

// get 删除学习卡列表数据
export function deleteCard(params) {
  return request({
    url: '/ops/card/deleteById',
    method: 'get',
    params: { id: params }
  })
}

// post 修改学习卡列表数据
export function updateCard(data) {
  return request({
    url: '/ops/card/update',
    method: 'post',
    data
  })
}

// post 通过批次ID查询学习卡列表
export function getListByBatchId(params) {
  return request({
    url: '/ops/card/getListByBatchId',
    method: 'get',
    params: { batchId: params }
  })
}

// get 查询虚拟币名称
export function getVirtualCurrencyName(params) {
  return request({
    url: '/ops/card/getVirtualCurrencyName',
    method: 'get',
    params: { tenantId: params }
  })
}
